package publishSubscribePattern;

/**
 * 观察者模式：
 */
public class Client {

    public static void main(String[] args) {
        // 主题
        SubscriptionSubject subscriptionSubject = new SubscriptionSubject();

        // 观察者
        Observer three = new WeiXinUser("张三");
        Observer four = new WeiXinUser("李四");

        subscriptionSubject.attach(three);
        subscriptionSubject.attach(four);
        // subscriptionSubject.detach(four);

        subscriptionSubject.notify("更新了游戏");
    }
}
